<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<nav class="navbar navbar-default" th:fragment="nav">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" th:href="@{/}" style="color: #ec971f">呆客</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a th:href="@{/question}">论坛</a></li>
                <!--<li class="dropdown">-->
                    <!--<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" >Dropdown <span class="caret"></span></a>-->
                    <!--<ul class="dropdown-menu">-->
                        <!--<li><a href="#">A</a></li>-->
                        <!--<li><a href="#">B</a></li>-->
                        <!--<li><a href="#">C</a></li>-->
                        <!--<li role="separator" class="divider"></li>-->
                        <!--<li><a href="#">Separated link</a></li>-->
                        <!--<li role="separator" class="divider"></li>-->
                        <!--<li><a href="#">One more separated link</a></li>-->
                    <!--</ul>-->
                <!--</li>-->
                <!--<li><a th:href="@{/test}">测试</a></li>-->
            </ul>
            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="输入搜索的内容">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right" >
                <li ><a th:href="@{/publish}">提问</a></li>
                <li><a th:href="@{/profile/replies}" >通知 <span class="badge " th:text="${session.unreadCount}" ></span></a></li>
                <li class="dropdown" th:if="${session.user != null}">
                <a href="#" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">
                        <span th:text="${session.user.getName()}"></span>
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a th:href="@{/profile/questions}">我的提问</a></li>
                        <li><a th:href="@{#}">个人登陆</a></li>
                        <li><a th:href="@{/logout}">退出登陆</a></li>
                    </ul>
                </li>

                <li th:if="${session.user == null}">
                    <!--<a href="https://gitee.com/oauth/authorize?client_id=ed2be54b47e52be78619518f9a756b171fc9d3e3af18d94b0224d130be7851be&redirect_uri=http://localhost:8080/giteecallback&response_type=code">登陆</a>-->
                    <a href="https://gitee.com/oauth/authorize?client_id=ed2be54b47e52be78619518f9a756b171fc9d3e3af18d94b0224d130be7851be&redirect_uri=http://daixin.fun/giteecallback&response_type=code">登陆</a>
                    <!--<a href="/test">登陆</a>-->
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
</body>
</html>